package org.yihang.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.yihang.entity.Condition;
import org.yihang.entity.Hero;
import org.yihang.mapper.HeroMapper;

@Service
public class HeroService {
	
	@Autowired
	private HeroMapper heroMapper;

	public void save(Hero hero) {
		heroMapper.save(hero);
	}

	public void update(Hero hero) {
		heroMapper.update(hero);
	}

	public void delete(int id) {
		heroMapper.delete(id);
	}

	public void deleteByIds(List<Integer> ids) {
		heroMapper.deleteByIds(ids);
	}

	public Hero findById(int id) {
		return heroMapper.findById(id);
	}

	public List<Hero> findByCondition(Condition condition) {
		return heroMapper.findByCondition(condition);
	}

	public int findCount(Condition condition) {
		return heroMapper.findCount(condition);
	}	

}
